package club.xinghe.servlet.admin;

import club.xinghe.biz.ScoreBiz;
import club.xinghe.entity.Score;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * 说明:管理员查询所有成绩
 *
 */
@WebServlet("/getAllScoreServlet")
public class getAllScoreServlet extends HttpServlet {

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req,resp);
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //得到成绩列表,可以从中取到任何数据
        ScoreBiz scoreBiz=new ScoreBiz();
        List<Score> scoreList= scoreBiz.getName70();
        for (Score score:scoreList ) {
            System.out.println(
                      "学生姓名："+score.getStudent().getsName()
            );

        }
        System.out.println("学生数量"+scoreList.size());

        
    }
}
